home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 July / Chip Temmuz 2004.iso / program / antispam / RazorAgent_SDK / razor-agents-sdk-2.03.exe / Digest-MD5-2.20 / t / badfile.t next >
Encoding:
Text File  |  1999-07-28  |  473 b   |  22 lines

  1. # Digest::MD5 2.07 and older used to trigger a core dump when
  2. # passed an illegal file handle that failed to open.
  3.  
  4. print "1..2\n";
  5.  
  6. use Digest::MD5 ();
  7.  
  8. $md5 = Digest::MD5->new;
  9.  
  10. eval {
  11.    use vars qw(*FOO);
  12.    $md5->addfile(*FOO);
  13. };
  14. print "not " unless $@ =~ /^Bad filehandle: FOO/;
  15. print "ok 1\n";
  16.  
  17. open(BAR, "none-existing-file.$$");
  18. $md5->addfile(*BAR);
  19.  
  20. print "not " unless $md5->hexdigest eq "d41d8cd98f00b204e9800998ecf8427e";
  21. print "ok 2\n";
  22.